<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="../../common/tagInclude.jsp"%>
<%@ taglib uri="http://java.fckeditor.net" prefix="FCK"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
	<base href="${basePath}" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<LINK href="${basePath}styleAdmin/css/portalinabox.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="${basePath}styleAdmin/js/prototype-1.6.0.3.js"></script>
<script type="text/javascript" src="${basePath}styleAdmin/js/common.js"></script>
<script type="text/javascript" src="${basePath}styleAdmin/js/Calendar/WdatePicker.js"></script>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<title>新闻内容<c:choose><c:when test="${act == 'update'}">修改</c:when><c:otherwise>添加</c:otherwise></c:choose></title>
<script type="text/javascript">
	function checkForm(){
		var errors = "" ;
		if(stringTrim($F('title')) == "" ){
			errors += "标题为空<br/>" ;
		}
		if(stringTrim($F('websiteId')) == "" ){
			errors += "来源不能为空<br/>" ;
		}
		if(stringTrim($F('userId')) == "" ){
			errors += "发布人不能为空<br/>" ;
		}
		if(stringTrim($F('publishTime')) == "" ){
			errors += "发布时间<br/>" ;
		}
		if(errors.length > 0){
			$('errors').innerHTML = "<font color='red' size='12'>" + errors  + "</font>" ;
			return ;
		} 
		document.myform.submit();
	}
</script>
</head>
<body bottomMargin="0" leftMargin="0" rightMargin="0" topmargin="0">
<form name="myform" method="post" action="${basePath}admin/contentInfo/${act}.do">
<%@include file="../common/navigate.jsp" %>
<input type="hidden" id="contentId" name="contentId" value="${content.contentId}"/>
<table width="90%" border="0" align="center" cellPadding="0" cellSpacing="0" style="margin-top:5px;">
 <tr><td align="center" colspan="2"><div id="errors"></div></td></tr>
 <tr>
	<td vAlign="top" align="center" height="157">
		<table width="10" border="1" class="mainFunctionTable"  cellpadding="0" cellspacing="1">
        	<tr height="25" class="pLabel">
            	<td colspan="2" class="td_nwarpstyle" align="left">&nbsp;&nbsp;新闻内容<c:choose><c:when test="${act == 'update'}">修改</c:when><c:otherwise>添加</c:otherwise></c:choose></td>
            </tr>
            <tr>
         		<td align="center" width="10%">标题</td>
         		<td align="left"><input type="text" maxlength="100" name="title" id="title" size="80" value="${content.title}">&nbsp;&nbsp;<font color='red'>*</font></td>
    		 </tr>
			<tr>
         		<td align="center" width="10%">来源</td>
         		<td align="left">
         			<select id="websiteId" name="websiteId" class="required" disabled="disabled">
						<option value="">请选择来源</option>
						<c:forEach var="websiteInfo" items="${websiteInfoList}">
							<option value="${websiteInfo.id}" <c:if test="${websiteInfo.isSelf == 1}">selected</c:if> >${websiteInfo.name}</option>
						</c:forEach>
					</select>
         			&nbsp;&nbsp;<font color='red'>*</font>
         		</td>
    		 </tr>
    		 <tr>
         		<td align="center" width="10%">发布人</td>
         		<td align="left">
         			<select id="userId" name="userId" class="required">
						<option value="">请选择发布人</option>
						<c:forEach var="userInfo" items="${userInfoList}">
							<c:choose>
								<c:when test="${act == 'update'}">
									<option value="${userInfo.id}" <c:if test="${userInfo.id == content.userId}">selected</c:if> >${userInfo.realName}</option>
								</c:when>
								<c:otherwise>
									<option value="${userInfo.id}" <c:if test="${userInfo.id == userId}">selected</c:if> >${userInfo.realName}</option>
								</c:otherwise>
							</c:choose>
						</c:forEach>
					</select>
         			&nbsp;&nbsp;<font color='red'>*</font>
         		</td>
    		 </tr>
    		 <tr>
         		<td align="center" width="10%">发布时间</td>
         		<td align="left"><input type="text" maxlength="100" name="publishTime" id="publishTime" size="35" value="${content.publishTime}"
					onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="Wdate">&nbsp;&nbsp;<font color='red'>*</font></td>
    		 </tr>
			<tr>
         		<td align="center" width="10%">内容:</td>
         		<td align="left"><FCK:editor height="380" width="95%" instanceName="text" value="${content.text}"></FCK:editor></td>
    		 </tr>
            <tr align="left">
              <td align="center" colspan="2">
	              <a href="javascript:checkForm();"><img src="${basePath}styleAdmin/images/button/save.gif" border=0></a>
	              &nbsp;&nbsp;
			      <a href="${basePath}admin/contentInfo/list.do"><img src="${basePath}styleAdmin/images/button/exit.gif" border=0></a>
              </td>
            </tr>
          </table>
      </td>
  </tr>
</table>
</form>
</body>
</html>